<html>
	<head>
		<title>TuneComparator: We even have a parrot.</title>
<script type="text/javascript" src="http://www.ccs.neu.edu/home/benglert/jquery.js"></script>
<script>
// Generate 32 char random uuid 
function gen_uuid() {
    var uuid = "";
    for (var i=0; i < 32; i++) {
        uuid += Math.floor(Math.random() * 16).toString(16); 
    }
    return uuid;
}

var freq = 1000; // freqency of update in ms
var progress_url = '/tc/upload_progress'; // ajax view serving progress info
var uuid = gen_uuid(); // id for this upload so we can fetch progress info.

// Update progress bar
function update_progress_info() {
    $.getJSON(progress_url, {'X-Progress-ID': uuid}, function(data, status){
        if (data) {
            var progress = parseInt(data.uploaded) / parseInt(data.length);
        //    $('#progress-info').text('Uploading: ' + parseInt(progress*100) + '%');
        }
        setTimeout('update_progress_info()', freq);
    });
}

// Add upload progress for multipart forms.
/*$(function() {
	

    $('form[enctype=multipart/form-data]').submit(function(){ 
        // Prevent multiple submits
        if ($.data(this, 'submitted')) return false;

        // Append X-Progress-ID uuid form action
        this.action += (this.action.indexOf('?') == -1 ? '?' : '&') + 'X-Progress-ID=' + uuid;    
        setTimeout('update_progress_info()', freq);

        $.data(this, 'submitted', true); // mark form as submitted.
    });
});*/

$(document).ready(function(){

$('#hidden').hide();

$('a#click').click(function(){
	$('#hidden').show('fast');
});


});

</script>
<LINK Rel=StyleSheet href="http://benglert.vzcgi.ccs.neu.edu/site.css" type="text/css">
</head>
<body>
	<div id="header">
		<a href="/tc"><img src="http://files.miazmatic.com/tc/header.png"></a>
	</div>
	<div id="maincontent">
	
				<h1>Upload your iTunes library XML file to create a key</h1>
				<form method="POST" enctype="multipart/form-data" action="{{uploadaction}}">
				{{uploadform.as_p}}	
				<input type="submit" value="Register" />
				</form>
				
				<p id="progress-info">Please be patient - iTunes libraries are large files and can take some time to upload.</p>
				<br><br>
				<a href="#" id="click">Why a random key instead of a screen name?</a>
				<div id="hidden">
				<p>Unfortunately, in this litigious day and age, information about who has what copyrighted content sitting on their computer is 
					incredibly valuable to some groups we may or may not be especially fond of. If we let you enter a screen name, chances are you'll use the same
					one you use elsewhere, and then our information about your music collection will become identifiable. </p>
					<p>
						By generating a random key and not logging when it was created (or from which IP address), we ensure that the information stored in tunecomparator is essentially worthless to anyone who doesn't know your key. We're hoping this will allow everyone to use the site with no privacy concerns.
				
					</p>
				</div>
	</div>
	<div id="footer">
		<a href="http://comparetunes.tumblr.com" target="_blank">blog</a> | <a href="http://twitter.com/tunecomparator" target="_blank">twitter</a> | 2009 by <a href="http://miazmatic.com" target="_blank">b</a> plus <a href="http://midoriw.tumblr.com" target="_blank">m</a>
	</div>
</body>
</html>